package cn.iocoder.an.module.mold.dal.mysql.upkeepstatics;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.mold.dal.dataobject.upkeepstatics.UpkeepStaticsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.mold.controller.admin.upkeepstatics.vo.*;

/**
 * 保养统计 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface UpkeepStaticsMapper extends BaseMapperX<UpkeepStaticsDO> {

    default PageResult<UpkeepStaticsDO> selectPage(UpkeepStaticsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UpkeepStaticsDO>()
                .eqIfPresent(UpkeepStaticsDO::getAccountId, reqVO.getAccountId())
                .eqIfPresent(UpkeepStaticsDO::getDrawingNoId, reqVO.getDrawingNoId())
                .eqIfPresent(UpkeepStaticsDO::getUpkeepId, reqVO.getUpkeepId())
                .eqIfPresent(UpkeepStaticsDO::getUpkeepCounts, reqVO.getUpkeepCounts())
                .betweenIfPresent(UpkeepStaticsDO::getUpkeepTotalTime, reqVO.getUpkeepTotalTime())
                .eqIfPresent(UpkeepStaticsDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(UpkeepStaticsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UpkeepStaticsDO::getId));
    }

}